package com.example.demo.entity;

import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Objects;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.IntToLongFunction;
import java.util.function.Supplier;

/**
 * Result Created by Liteng.
 *
 * @author Liteng
 * @date 2020/04/07 16:17
 */

/**
 * Response统一数据格式
 * 保留
 * @param <T>
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public final class Result<T> implements Serializable {

    private static final long serialVersionUID = 1L;
    /**
     * 状态码,200,300,310等，具体含义参见接口说明文档
     */
    //
    private int code;

    /**
     * 业务数据
     */
    //
    private T data;

    /**
     * 状态描述，与状态码对应，可用于App端按需展示
     */
    //
    private String msg;

    private Result() {
    }

    /**
     * @author 蔡定努
     */
    public static <T> Result<?> success(T data) {
        Result<T> tResult = new Result<>();
        tResult.code=200;
        tResult.data=data;
        return tResult;
    }

    public static void main(String[] args) {
    }


}
